package com.buka.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.buka.dao.PayDao;
import com.buka.entity.Pay;
import com.buka.service.PayService;
import com.buka.service.PayTccAction;
import io.seata.rm.tcc.api.BusinessActionContext;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * (Pay)表服务实现类
 *
 * @author makejava
 * @since 2025-07-14 21:23:05
 */
@Service("payService")
public class PayServiceImpl extends ServiceImpl<PayDao, Pay> implements PayService {


    @Resource
    private PayTccAction payTccAction;
    @Override
    public boolean createPayment(Pay pay) {
        long pid = System.currentTimeMillis();
        pay.setId(pid);
        return payTccAction.prepareCreatePayment(null, pay);
    }
}

